package com.entor.model;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name="t_class")//表示这个实体对应数据库的哪一个表
public class TClass {
	
	@Id
	@Column(name="id",nullable=false)//该属性对应数据库的那一列
	@GeneratedValue(strategy=GenerationType.AUTO)//主键生成策略  Mysql主键自动增长
	/*@SequenceGenerator(name="class_seq",sequenceName="seq_urc_id",allocationSize=1)//name为自定义名称，sequenceName为数据库对应序列的名称 oracle
	@GeneratedValue(generator="class_seq",strategy=GenerationType.SEQUENCE)*/
	private Integer id;
	
	private String name;
	
	//@Column(name="user_name")
	@Transient
	private String userName;
	@Transient
	private List ls;
	
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	public List getLs() {
		return ls;
	}
	public void setLs(List ls) {
		this.ls = ls;
	}
	@Override
	public String toString() {
		return "TClass [id=" + id + ", name=" + name + "]";
	}
	

}
